package org.leon.demo.controller;

import org.leon.demo.service.UserService;
import org.leon.mvcframework.annotations.MvcAutowired;
import org.leon.mvcframework.annotations.MvcController;
import org.leon.mvcframework.annotations.MvcRequestMapping;
import org.leon.mvcframework.annotations.Security;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@MvcController
@MvcRequestMapping("/demo")
public class DemoController {

    @MvcAutowired
    private UserService userService;


    @MvcRequestMapping("/query")
    @Security(value = {"uu3"})
    public void query(HttpServletRequest request, HttpServletResponse response, String name){
        try {
            response.getWriter().write("Verify successfully, Welcome " + name);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
